#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "dialog_newlistfile.h"
#include "ui_dialog_newlistfile.h"

#include "dialog_set.h"
#include "ui_dialog_set.h"
#include "dialog_about.h"
#include "ui_dialog_about.h"

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

    QString FileIndexStartAddr;
    QString FileDataStartAddr;

    bool CheckID(QString addr);
    void fileaddlist(QString ID,QString addr,QString fileName);
    void setFileAddr(QString indexaddr , QString dataaddr);


private slots:
    void on_action_triggered();
    bool maybeSave();


    bool save();      // 保存操作
    bool saveAs();    // 另存为操作
    bool saveFile(const QString &fileName); // 保存文件

    void on_action_2_triggered();
    bool loadFile(const QString &fileName);
    void on_action_4_triggered();

    void on_action_3_triggered();

    void on_actionLiangcun_triggered();

    void on_pb_addfile_clicked();

    void on_pb_delfile_clicked();

    void on_pushButton_clicked();

    void on_pb_build_clicked();

    void on_actionGug_triggered();

private:
    Ui::MainWindow *ui;

    bool isUntitled;

    QString curFile;
    Dialog_newListFile *newListFile;
    Dialog_SET *DialogFileaddr;
    Dialog_about *Dialogabout;

};

#endif // MAINWINDOW_H
